IntroductionIn the field of business, to customer deployment projects, three projects to be integrated together, which results in different data formats, the path of the slash and backslash caused a lot of problems.Check out this information, here
This article translated several articles and briefly introduced ATL catlregexp, Greta, boost: RegExSuch as regular expression library, these Expression Libraries allow us to easily take advantage of the great power of the Regular Expression Library,
(Original: HTTPS://BLOG.BITSRC.IO/A-BEGINNERS-GUIDE-TO-REGULAR-EXPRESSIONS-REGEX-IN-JAVASCRIPT-9C58FEB27EB4)When you first see the regular, they are like random stacked characters that look meaningless. But although they seem tricky (because of the
Java intercept backslash ReplaceAll and split ("\") Problem resolutionXxx.split ("\ \") is obviously not getting the results you want.Correct methodXxx.split ("\\\\");The reasons are as follows:In Java to deal with some path-related problems, such
For example: Gets the file path to C:\Documents and Settings\leeo\my documents\logo.gifNow want to get the name of the picture logo.gif, we know that the backslash "\" is an escape character, so you cannot directlyString temp[] = filepath.split ("\")
PHP regular match backslash '\' and dollar '$', php slash
This example describes the PHP Regular Expression matching method with the backslash '\' and dollar '$. We will share this with you for your reference. The details are as follows:
1. test.
Java replaceall backslash \ string S=new string ("This is a \ \"); S.replaceall ("\ \", "back Slash");Using the code above will causejava.util.regex.PatternSyntaxException:Unexpected Internal error near index 1 \ ^ErrorThe original is to use
String dz = "D:workspace\tximage\a.png";You want to use the split () function to intercept the string.The code is as follows:String td[]=dz.split ("\\\\");if (td.length>1) {for (int i=0;i{System.out.println (Td[i]);}String last =
Regular expressions provide a compact notation that can be used to represent a combination of strings, and a single regular expression can represent an infinite number of strings. 5 Common uses: analysis, search, search and Replace, string
For example, the obtained file path is C:/Documents and Settings/Leeo/My Documents documents/logo.gif.
Now we want to get the image name logo.gif. We know that the Backslash "/" is an escape character, so we cannot directly
String temp [] =
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.